package com.example.testplanetorbit

import android.graphics.*

/**
 * 最内圈的椭圆轨道，
 * 只有小圆点，没有带文字的标记点
 */
class InnerOrbit : OrbitData() {

    override fun init(ovalConfig: OvalConfig) {
        super.init(ovalConfig)

        ovalDot.init(false)
        ovalDot2.init(false)
        ovalDot2.initDistance(0.5f)
    }

    override fun optimazeConfig() {
        if (mOvalCofig?.circle == 1) {
            val maxHR = 128f / 360f
            val minHR = 118f / 260f
            val maxVR = 84f / 360f
            val minVR = 64f/ 360f

            mOvalCofig!!.horizontal_r_max = ((mOvalCofig?.mParentWidth?:0) * maxHR * 0.5f).toInt()
            mOvalCofig!!.horizontal_r_min = ((mOvalCofig?.mParentWidth?:0) * minHR * 0.5f).toInt()
            mOvalCofig!!.horizontal_r = mOvalCofig!!.horizontal_r_max

            mOvalCofig!!.vertical_r_max = ((mOvalCofig?.mParentWidth?:0) * maxVR * 0.5f).toInt()
            mOvalCofig!!.vertical_r_min = ((mOvalCofig?.mParentWidth?:0) * minVR * 0.5f).toInt()
            mOvalCofig!!.vertical_r = mOvalCofig!!.vertical_r_min
        }
    }

    override fun clickDot(point: PointF): OvalTagDot.Data? {
        return null
    }

    override fun changeHorizontal(moveLeft:Boolean) {
        ovalDot.changeHorizontal(moveLeft)
        ovalDot2.changeHorizontal(moveLeft)
    }

    private val degressRadio = 1.0f


    override fun drawOval1(canvas: Canvas?) {
        ovalDot.drawOval1(canvas)
        ovalDot2.drawOval1(canvas)
    }

    override fun setStepLock(lock:Boolean) {
        ovalDot.lock = lock
        ovalDot2.lock = lock
    }

    var ovalDot = OvalDot()
    var ovalDot2 = OvalDot()

   override  fun setPathMeasure1() {
        ovalDot.setPath(re21, resetPath)
        ovalDot2.setPath(re21, resetPath)
    }

    override fun drawText(canvas: Canvas?) {
    }
}